# while循环
# 语法:
"""
while 条件表达式:
    代码块 (循环体)
"""

# 需求让a循环三次
"""
a = 'bbb'
i = 0
while i < 3:
    i += 1
    print(a)
"""
# 循环100次
"""
i = 0
while i < 100:
    i += 1
    print(i)
"""
# 输出0~100的和
"""
i = 0
a = 0
while i < 100:
    i += 1
    a += i
    print(a)
"""
# 输出1~100之间的偶数
# 方法一
"""
i = 0
while i < 100:
    i += 2
    print(i)
"""
# 方法二
"""
i = 1
while i < 101:
    i += 1
    if i % 2 == 0:
        print(i)
"""
# 输出1~100之间的奇数相加

i = 1
a = 0
while i < 101:
    if i % 2 != 0:
        a += i
    i += 1
print(a)

